/**
 * @Author: liutao
 * @Date:   2017-04-25T10:16:14+08:00
 * @Email:  947809647@qq.com
 * @Last modified by:   liutao
 * @Last modified time: 2017-04-25T10:56:36+08:00
 */

export const formatMillisecond = (val) => {
  if (val && typeof val === 'number') {
    let date = new Date(val)
    let year = date.getFullYear()
    let mouth = date.getMonth() + 1
    let day = date.getDate()
    let hour = date.getHours()
    let minutes = date.getMinutes()
    return `${year}-${mouth}-${day} ${hour}:${minutes}`
  }
  return val
}

export const getStatusTxt = (status) => {
  let statusMap = {
    1: '未领',
    2: '已领',
    3: '已登录',
    4: '已审核',
    5: '不发',
    6: '已到账',
    7: '到帐失败',
    8: '过期',
    9: 'imei已经使用过'
  }
  return statusMap[status]
}
